package study.仪器解析.串口化通信.生化仪;

import cn.hutool.http.HttpRequest;
import cn.hutool.json.JSONUtil;
import study.User;

import java.util.*;

/**
 * @Author 刘伟涛
 * @Date 2024/6/14 13:47
 **/
public class HttpUtils {
    public static void main(String[] args) {
        List<User> list = Arrays.asList(new User(1, "张三"), new User(2, "李四"));
        String json = JSONUtil.parseArray(list).toString();
        String url = "http://localhost:80/api/data/receive";
        String result = HttpRequest.post(url)
                .body(json)
                .execute().body();
        System.out.println(result);
    }
}
